﻿using System;
using System.Collections.Generic;
using UnityEngine;

namespace H
{
	// Token: 0x02000264 RID: 612
	internal class H_State_OutEjaIn : H_State
	{
		// Token: 0x06001020 RID: 4128 RVA: 0x00067A24 File Offset: 0x00065C24
		public H_State_OutEjaIn(H_Members members) : base(members)
		{
		}

		// Token: 0x06001021 RID: 4129 RVA: 0x00067A38 File Offset: 0x00065C38
		public override void In(H_State.Message msg)
		{
			this.members.param.continuanceXTC_F = 0;
			this.members.AddCountXTC();
			this.members.param.manyEjaculation = (this.members.MaleGageVal >= 1f);
			this.members.PlayAnime("OutEja_In", 0.2f);
			this.members.param.mouth = H_MOUTH.FREE;
			this.members.EnableTinIK = false;
			this.members.VoiceExpression(H_Voice.TYPE.XTC_M);
			this.members.MaleExpression(H_Expression_Male.TYPE.EJACULATION);
			this.ejaculated = false;
			this.timer = 0f;
		}

		// Token: 0x06001022 RID: 4130 RVA: 0x00067AE4 File Offset: 0x00065CE4
		public override void Main()
		{
			if (!this.ejaculated && this.timer >= this.ejaculationDelay)
			{
				this.Ejaculation();
			}
			else
			{
				this.timer += Time.deltaTime;
			}
			if (this.members.CheckEndAnime("OutEja_In"))
			{
				if (!this.ejaculated)
				{
					this.Ejaculation();
				}
				base.ChangeState(H_STATE.OUT_EJA_TREMBLE, null);
			}
		}

		// Token: 0x06001023 RID: 4131 RVA: 0x00067B5C File Offset: 0x00065D5C
		private void Ejaculation()
		{
			List<Male> males = this.members.GetMales();
			for (int i = 0; i < males.Count; i++)
			{
				males[i].Ejaculation(this.members.param.manyEjaculation);
			}
			this.members.MaleGageVal = 0f;
			this.ejaculated = true;
		}

		// Token: 0x06001024 RID: 4132 RVA: 0x00067BC0 File Offset: 0x00065DC0
		public override void Out()
		{
		}

		// Token: 0x04001170 RID: 4464
		private bool ejaculated;

		// Token: 0x04001171 RID: 4465
		private float ejaculationDelay = 0.5f;

		// Token: 0x04001172 RID: 4466
		private float timer;
	}
}
